import { createRouter, createWebHashHistory } from 'vue-router'
import MainView from '../views/MainView.vue'
import HomeView from '../views/HomeView.vue'
import CardTableView from '../views/CardTableView.vue'
import GoodsView from '../views/GoodsView.vue'
import SalesCardTableView from '../views/SalesCardTableView.vue'
import ChartsView from '../views/ChartsView.vue'
import SalesGoodsView from '../views/SalesGoodsView.vue'

const routes = [
  
  {
    path: '/',
    name: 'main',
    component: MainView,
    children: [
      {
        path: 'home',
        name: 'HomeView',
        component: HomeView,
      },
      {
        path: 'cardTable',
        name: 'CardTableView',
        component: CardTableView,
      },
      {
        path: 'goods',
        name: 'GoodsView',
        component: GoodsView,
      },
      {
        path: 'salesCardTable',
        name: 'SalesCardTableView',
        component: SalesCardTableView,
      },
      {
        path: 'salesGoods',
        name: 'SalesGoodsView',
        component: SalesGoodsView,
      },
      {
        path: 'charts',
        name: 'ChartsView',
        component: ChartsView,
      }
    ]
  }
]

const router = createRouter({
  model: "hash",
  history: createWebHashHistory(),
  routes
})

export default router
